//排序+二分查找
class Solution {
public:
    using ll=long long;
    vector<int> successfulPairs(vector<int>& spells, vector<int>& potions, long long success) {
        sort(potions.begin(), potions.end());
        for(int &spell:spells)
        {
            ll target=(success-1)/spell; //不成立的最大值
            if(target<potions.back()) 
                spell=potions.end()-ranges::upper_bound(potions, (int)target);
            else spell=0; //没有可以实现的

        }
        return spells;
    }
};